#ifndef TEXTBUFFER_H_
#define TEXTBUFFER_H_

#include <string>

using namespace std;

class Buffer
{
    char* data;
    unsigned int offset;

    char* _get_offset_pointer();

public:
    Buffer();
    Buffer(char* data);
    virtual ~Buffer();

    void assign_raw_data(char* data);

    unsigned int get_offset();
    unsigned int set_offset(unsigned int offset);
    unsigned int move_offset(int delta);
    void rewind();

    char get_current_char();

    char get_char();
    short get_short();
    int get_int();
    string get_string();

    void put_char(char value);
    void put_short(short value);
    void put_int(int value);
    void put_string(string value);
};

#endif /*TEXTBUFFER_H_*/
